﻿// Inner Fire 游戏引擎库
// UI深度图
//
// Copyright (c) 2025 by 尔西大帝. All rights reserved.
//
// 用于UI的深度图。和阴影这些使用的深度图暂时没有任何区别。
// 但是以后可能有区别，所以分开。
//
// Author: 尔西大帝
// Email: 2670613871@qq.com
// Created: 2024-01-08

#pragma once
  
#include <dx/texture/render_texture.h>

namespace ifire::dx {

class UIDepthMap : public RenderTexture {
public:
  UIDepthMap(ID3D12Device* device, UINT width, UINT height);
  UIDepthMap(const UIDepthMap& rhs) = delete;
  UIDepthMap& operator=(const UIDepthMap& rhs) = delete;
  ~UIDepthMap() = default;


  void BuildDescriptors(CD3DX12_CPU_DESCRIPTOR_HANDLE handle_cpu_srv,
      CD3DX12_GPU_DESCRIPTOR_HANDLE handle_gpu_srv,
      CD3DX12_CPU_DESCRIPTOR_HANDLE handle_cpu_dsv);
  
  CD3DX12_CPU_DESCRIPTOR_HANDLE mCpuSrv;
  CD3DX12_GPU_DESCRIPTOR_HANDLE mGpuSrv;
  CD3DX12_CPU_DESCRIPTOR_HANDLE mCpuDsv;
protected:
  void BuildDescriptors() override;
  void BuildResource() override;
};

} // namespace ifire::dx
